﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>软件管理中心</title>

    <script type="text/javascript">
        function checkedSearch() {
            if (document.getElementById("txtSSoftWareName").value == "") {
                alert("请输入查询条件");
                return false;
            }
            else
                return true;
        }
    </script>

    <style type="text/css">
         .table
        {
      table-layout:fixed;
        }
    </style>
</head>
<body>
    <a href="Search.aspx">进入查询</a>&nbsp;<a href="Default.aspx">进入添加</a>
    <form id="form1" runat="server">
    <asp:TextBox ID="txtSSoftWareName" runat="server"></asp:TextBox>
    <asp:Button ID="btnSarech" runat="server" Text="查询" OnClick="btnSarech_Click" OnClientClick="return checkedSearch()" />
    <br />
    <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
    <table>
        <tr>
            <td>
                <asp:GridView ID="gvwSoftWare" runat="server" AutoGenerateColumns="False" DataKeyNames="SoftWare_ID"
                    AllowPaging="True" OnPageIndexChanging="gvwSoftWare_PageIndexChanging" OnRowDataBound="gvwSoftWare_RowDataBound"
                    OnRowDeleting="gvwSoftWare_RowDeleting" PageSize="20" CssClass="table">
                    
                    <RowStyle Height="20px" Width="100px" />
                    
                    <Columns>
                        <asp:BoundField DataField="SoftWare_Name" HeaderText="软件名称" HeaderStyle-Width="200px"/>
                        <asp:BoundField DataField="SoftWare_Keywords" HeaderText="关键字" />
                        <asp:TemplateField HeaderText="是否可用" ShowHeader="False">
                            <ItemTemplate>
                                <asp:Label ID="lblSoftWare_IsOk" runat="server" Text='<%# GetIsOk(Eval("SoftWare_IsOk").ToString()) %>'> </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="是否安全" ShowHeader="False">
                            <ItemTemplate>
                                <asp:Label ID="lblSoftWare_IsSecure" runat="server" Text='<%# GetIsOk(Eval("SoftWare_IsSecure").ToString()) %>'> </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="SoftWare_Rating" HeaderText="商业等级" />
                        <asp:BoundField DataField="SoftWare_NetsiskAddress" HeaderText="网盘地址" />
                        <asp:BoundField DataField="SoftWare_WebsiteAddress" HeaderText="网站地址" />
                        <asp:TemplateField HeaderText="备注" ShowHeader="False">
                            <ItemTemplate>
                                <asp:Label ID="lblSoftWare_Remarks" runat="server" Text='<%# Common.Common_Function.StringNum(Eval("SoftWare_Remarks").ToString(),20) %>'> </asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="管理" ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" Text="编辑" OnClientClick='<%# GetClickUrl(Eval("SoftWare_ID").ToString()) %>'></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除" OnClientClick=""></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="gvwWebSite" runat="server" AutoGenerateColumns="False" OnRowDeleting="gvwWebSite_RowDeleting"
                    Width="635px" OnRowDataBound="gvwWebSite_RowDataBound" OnRowEditing="gvwWebSite_RowEditing"
                    OnRowCancelingEdit="gvwWebSite_RowCancelingEdit" OnRowUpdating="gvwWebSite_RowUpdating"
                    DataKeyNames="WebSite_ID" CssClass="table">
                    <Columns>
                        <asp:TemplateField HeaderText="网站名称" HeaderStyle-Width="100px">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtWebSite_Name" MaxLength="20" Width="80" runat="server" Text='<%# Bind("WebSite_Name") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblWebSite_Name" runat="server" Text='<%# Bind("WebSite_Name") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="网站地址" HeaderStyle-Width="300px">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtWebSite_Address" MaxLength="20" Width="80" runat="server" Text='<%# Bind("WebSite_Address") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblWebSite_Address" runat="server" Text='<%# Bind("WebSite_Address") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="收藏等级">
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlWebSiteRating" runat="server" SelectedValue='<%# Bind("WebSite_Rating") %>'>
                                    <asp:ListItem Text="1" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="2" Value="2"></asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblWebSite_Rating" runat="server" Text='<%# Bind("WebSite_Rating") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="管理" ShowHeader="False">
                            <EditItemTemplate>
                                <asp:LinkButton ID="lkbUpdate" runat="server" CausesValidation="True" CommandName="Update"
                                    Text="更新"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="lkbDelete" runat="server" CausesValidation="False" CommandName="Cancel"
                                    Text="取消"></asp:LinkButton>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="lkbEdit" runat="server" CausesValidation="False" CommandName="Edit"
                                    Text="编辑"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="lkbDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="gvwBusinessTag" runat="server" AutoGenerateColumns="False" OnRowDeleting="gvwBusinessTag_RowDeleting"
                    Width="635px" OnRowDataBound="gvwBusinessTag_RowDataBound" OnRowEditing="gvwBusinessTag_RowEditing"
                    OnRowCancelingEdit="gvwBusinessTag_RowCancelingEdit" OnRowUpdating="gvwBusinessTag_RowUpdating"
                    DataKeyNames="BusinessTag_ID">
                    <Columns>
                        <asp:TemplateField HeaderText="关键字">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtBusinessTag_Name" MaxLength="20" Width="80" runat="server" Text='<%# Bind("BusinessTag_Name") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblBusinessTag_Name" runat="server" Text='<%# Bind("BusinessTag_Name") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="管理" ShowHeader="False">
                            <EditItemTemplate>
                                <asp:LinkButton ID="lkbUpdate" runat="server" CausesValidation="True" CommandName="Update"
                                    Text="更新"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="lkbDelete" runat="server" CausesValidation="False" CommandName="Cancel"
                                    Text="取消"></asp:LinkButton>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="lkbEdit" runat="server" CausesValidation="False" CommandName="Edit"
                                    Text="编辑"></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="lkbDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
